package com.example.controller;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.example.idol.IDOL.Document;
import com.example.idol.IDOLApi;

@Controller
public class BusinessCardController {

	@Autowired
	private IDOLApi idolApi;
	
	public String getSFDCAccessToken(String grantType, String clientId, String clientSecret, String username, String password, String endpoint) {
		// OCR Document

		return null;
	}
	
	public String getTextFromOCR(String apiKey, String encodedImage) {
		return null;
	}

	/**
	 * 
	 * @param apiKey
	 * @param ocrText
	 * @param entityType
	 * @return name, company name, website address, email address, or location designated by the entity type.
	 */
	public String extractEntity(String apiKey, String ocrText, String entityType) {
		// Entity Extraction for Name
		// Entity Extraction for Phone Number
		// Entity Extraction for Company Name
		// Entity Extraction for Email Address
		// Entity Extraction for Name
		return null;
	}

	// the document object will need to be created from the available // fields in the FindSimiliar documents or Query IDOL OnDemand API 
	// JSON response
	public List<Document> findSimilarDocuments(String apiKey, String companyName, String searchType) {
		// Find Similar from Wikipedia with company name
		// Find Similarto get news related to the company
		return null;
	}

	/**
	 * Search an account by company name in the user's Salesforce org
	 * @param accessToken
	 * @param companyName
	 * @return
	 */
	public boolean doesAccountExist(String accessToken, String companyName) {
		return true;
	}

	/**
	 * 
	 * @param accessToken
	 * @param companyName
	 * @return Account.Id
	 */
	public String insertAccount(String accessToken, String companyName) {
		return null;
	}

	/**
	 * 
	 * @param accessToken
	 * @param firstName
	 * @param lastName
	 * @param companyId
	 * @param emailAddress
	 * @param phoneNumber
	 * @param city
	 * @param state
	 * @param website
	 * @return Contact.Id
	 */
	public String insertContact(String accessToken, String firstName, String lastName, String companyId, String emailAddress, String phoneNumber, 
				String city, String state, String website) {
		return null;
	}

	/**
	 * 
	 * @param accessToken
	 * @param firstName
	 * @param lastName
	 * @param companyName
	 * @param emailAddress
	 * @param phoneNumber
	 * @param city
	 * @param state
	 * @param website
	 * @return Lead.Id
	 */
	public String insertLead (String accessToken, String firstName, String lastName, String companyName, String emailAddress, String phoneNumber, 
				String city, String state, String website) {
		return null;
	}

	/**
	 * 
	 * @param accessToken
	 * @param startTime
	 * @param endTime
	 * @param subject
	 * @param type
	 * @param whoId
	 * @param priority
	 * @param status
	 * @return Activity.Id
	 */
	public String insertActivity (String accessToken, Date startTime, Date endTime, String subject, String type, String whoId, String priority, 
				String status) {
		// Task type: Send an Email, Set follow up call
		// Event type: Meeting(1hr length default)
		return null;
	}

	/**
	 * 
	 * @return list of URLs that will be displayed on the confirmation screen.
	 */
	public List<String> getURLsForRelatedNewsItems() {
		return null;
	}

}
